package com.mxpio.erp.common.jpa.model;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

import com.mxpio.erp.common.jpa.policy.ResCodeGeneratorPolicy;
import com.mxpioframework.jpa.annotation.Generator;
import com.mxpioframework.security.annotation.Dict;
import com.mxpioframework.security.entity.BaseEntity;
import com.mxpioframework.security.entity.User;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@MappedSuperclass
@EqualsAndHashCode(callSuper=false)
public class Partner extends BaseEntity {
	
	private static final long serialVersionUID = 1L;
	
	@Id
	@Column(name = "PN_CODE_", updatable = false)
	@Generator(policy = ResCodeGeneratorPolicy.class)
	@Schema(description = "伙伴编号")
	private String pnCode;
	
	@Column(name = "PN_NAME_")
	@Schema(description = "公司名称")
	private String pnName;
	
	@Column(name = "PN_ABBR_")
	@Schema(description = "公司简称")
	private String pnAbbr;
	
	@Column(name = "PN_AREA_")
	@Schema(description = "地区")
	@Dict(dicCode = "ERP_COMMON_PARTNER_AREA")
	private String pnArea;

	@Column(name = "PN_ADDRESS_")
	@Schema(description = "公司地址")
	private String pnAddress;
	
	@Column(name = "PN_KEY_")
	@Schema(description = "社会统一信用代码证号")
	private String pnKey;
	
	@Column(name = "PN_ZIP_CODE_")
	@Schema(description = "邮政编码")
	private String pnZipCode;

	@Column(name = "PN_CONTACTS_")
	@Schema(description = "公司联系人")
	private String pnContacts;

	@Column(name = "PN_PHONE_")
	@Schema(description = "手机")
	private String pnPhone;

	@Column(name = "PN_TEL_")
	@Schema(description = "电话")
	private String pnTel;

	@Column(name = "PN_FAX_")
	@Schema(description = "传真")
	private String pnFax;
	
	@Column(name = "BIZ_MAN_")
	@Schema(description = "业务员")
	@Dict(dicCode = "username", dicEntity = User.class, dicText = "nickname")
	private String bizMan;
	
}
